from django.db import models
from django.contrib.auth.models import User
from datetime import datetime
# Create your models here.

DEGREE_TYPE = ((u'本科', u'本科'), (u'硕士', u'硕士'), (u'博士', u'博士'))

JobTypes = [
    (0,"技术类"),
    (1,"产品类"),
    (2,"运营类"),
    (3,"设计类"),
    (4,"市场营销类")
]

Cities = [
    (0,"北京"),
    (1,"上海"),
    (2,"深圳"),
    (3,"杭州"),
    (4,"广州")
]


class Job(models.Model):
    job_type =models.SmallIntegerField(blank=False, choices=JobTypes, verbose_name='职位类型')
    job_name = models.CharField(max_length=50, blank=False,verbose_name='职位名')
    job_city = models.SmallIntegerField(blank=False, choices=Cities, verbose_name='工作城市')
    job_responsibility = models.TextField(max_length=1024, verbose_name='岗位职责',)
    job_requirement = models.TextField(max_length=1024, verbose_name='职位要求',blank=False )
    creator = models.ForeignKey(User, verbose_name='创建人', null=True, on_delete=models.SET_NULL)
    create_date = models.DateTimeField(verbose_name="创建日期",auto_now_add=True)
    modify_date = models.DateTimeField(verbose_name='修改时间',auto_now=True)

    class Meta:

        verbose_name = u'岗位'
        verbose_name_plural = u'岗位'

        def __str__(self):
            return self.job_name

